import React from 'react';
import { inject, observer } from 'mobx-react';

import E9CustomElement from './E9CustomElement';

@inject('portalLoginStore')
@observer
class E9Custom extends React.Component {
    render() {
        const { portalLoginStore } = this.props;
        const { state = {} } = portalLoginStore;
        const { customElements = [] } = state;

        return (
            <div className="e9login-custom">
                {
                    customElements.map((item, index) => <E9CustomElement ecId={`${this && this.props && this.props.ecId || ''}_E9CustomElement@uvwgoy@${index}`} key={index} item={item} />)
                }
            </div>
        );
    }
}

export default E9Custom;
